//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.Blackboard.Wcf
{
    using System;
    using System.ServiceModel;
    using Microsoft.Research.eResearch.Blackboard.Common;

    /// <summary>
    /// The WCF-exposed interface for the <see cref="WcfPublisherMessageService"/>.
    /// </summary>
    [ServiceContract]
    public interface IWcfPublisherMessageService
    {
        /// <summary>
        /// Registers the specified return address of the publisher.
        /// </summary>
        /// <param name="returnAddress">The return address of the publisher.</param>
        /// <returns>The initial subscription profile.</returns>
        [OperationContract]
        SubscriptionProfile Register(Uri returnAddress);

        /// <summary>
        /// Unregisters the specified return address of the publisher.
        /// </summary>
        /// <param name="returnAddress">The return address of the publisher.</param>
        [OperationContract(IsOneWay = true)]
        void Unregister(Uri returnAddress);

        /// <summary>
        /// Publishes the specified message to the Blackboard.
        /// </summary>
        /// <param name="message">The blackboard message to publish.</param>
        [OperationContract(IsOneWay = true)]
        void Publish(BlackboardMessage message);
    }
}
